<?php
/**
 * MageWorx
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the MageWorx EULA that is bundled with
 * this package in the file LICENSE.txt.
 * It is also available through the world-wide-web at this URL:
 * http://www.mageworx.com/LICENSE-1.0.html
 *
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@mageworx.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade the extension
 * to newer versions in the future. If you wish to customize the extension
 * for your needs please refer to http://www.mageworx.com/ for more information
 * or send an email to sales@mageworx.com
 *
 * @category   design_default
 * @package    MageWorx_XSitemap
 * @copyright  Copyright (c) 2009 MageWorx (http://www.mageworx.com/)
 * @license    http://www.mageworx.com/LICENSE-1.0.html
 */
?>
<?php $_items = $this->getCategories(); ?>
<?php if(count($_items)): ?>
<h3><?php echo $this->__('Catalog') ?></h3>
<ul class="categories">
<?php $_level = 0 ?>
<?php foreach ($_items as $_item): ?>
<?php if ($_level < $this->getLevel($_item)): ?><ul class="categories"><?php endif ?>
<?php if ($_level > $this->getLevel($_item)): echo '</li>' . str_repeat('</ul></li>', $_level - $this->getLevel($_item)); endif ?>
<?php if ($_level && $_level == $this->getLevel($_item)): ?></li><?php endif ?>
<li class="level-<?php echo $this->getLevel($_item) ?> category"><a href="<?php echo $this->getItemUrl($_item) ?>"><?php echo $_item->name ?></a>
<?php if ($this->showProducts()): ?>
<?php echo $this->getChild('category_products')->setCategory($_item)->toHtml() ?>
<?php endif ?>
<?php $_level = $this->getLevel($_item) ?>
<?php endforeach; ?>
<?php echo str_repeat('</li></ul>', $_level + 1) ?>
<?php endif ?>
